UserAddFormCtl = Ext.extend(FormCtl, {

			configItems : function(config) {
				
				var depUrl = cf.getC('s').getUrl({
				
					resource : 'department.do',
					act : 'findAll'
					
				});

				var items = [this.getTextField('用户名', 'username'),
						this.getTextField('密码', 'password'),
						this.getCombobox('部门', 'departmentid', false, depUrl,true)
				]
				
				this.items = items;

				var groupItems = [{
							columnWidth : .5,
							layout : 'form',// 第一列里面内容就是form排序了,从上到下
							items : [items[0], items[1]]
						}, {
							columnWidth : .5,
							layout : 'form',// 第一列里面内容就是form排序了,从上到下
							items : [items[2]]
						}];

				config.items = groupItems;

				return config;

			},
			getCommonConfig : function() {

				var config = {
					split : true,
					autoScroll : true,
					region : 'center',
					layout : 'column',
					labelAlign : 'right',
					labelWidth : 100,
					frame : true
				};

				return config;

			},
			configButtons : function(config) {

				return config;

			},
			getFormHeight : function() {

				return 280;

			},
			getSubmitUrl : function() {

				return 'user.do?m=create';

			},
			getLoadUrl : function() {

				return 'user.do?m=read';

			},
			submitSuccess : function(from, action) {
				var cigc = cf.getC('usrmger');
				cigc.reload();
			},
			getLoadParams : function(record) {
				return {
					id : record.get('id')
				}

			},
			configReader : function(config) {

				config.reader = new Ext.data.JsonReader({
							root : 'items'
						}, [{
									name : 'username',
									mapping : 'username',
									type : 'string'
								}, {
									name : 'password',
									mapping : 'password',
									type : 'string'
								}, {
									name : 'departmentid',
									mapping : 'departmentid',
									type : 'string'
								}])

				return config;

			},
			getParams : function(config) {

				var items = this.getAllItems();

				var params = {
					itemlist : Ext.encode(items)
				};

				config.params = params

				return config;

			},
			getAllItems : function() {

				var oigc = cf.getC('rgc');
				var records = oigc.getSelectList();

				var idList = [];
				for (var i = 0; i < records.length; i++) {
					idList.push({
								id : records[i].get('id')
							});
				}

				return idList;

			}

		});